|
2020-2021 Sunseeker Telemetry and Lighting System
|
#include "driverlib.h"Go to the source code of this file.
Functions | |
| void | delay (void) |
| void | main (void) |
| void delay | ( | void | ) |
ADC10_A - Sample A1 Input, Toggle Internal Reference
MSP430F550x Demo Sample and convert analog voltage at ADC i/p ch A1 in single channel single conversion mode. Internal reference is toggled between 1.5V and 2.5V and the ADC measurements are made. With 1V input at A1, Vref+ of 1.5V and 2.5V gives ADC conv result of ~682 and ~409 respectively. LED at P1.0 is turned on when ADC conv result >500 (that is with Vref=1.5V) and turned off otherwise (when Vref=2.5V) Basically with an input between 0.8V and 1.3V the LED will toggle consistently, with an input below 0.8V the LED will stay off, and an input above 1.3V the LED will remain on. ACLK = n/a, MCLK = SMCLK = default DCO ~1.2MHz, ADC10CLK = ADC10OSC
MSP430F550x
-----------------
/|\| XIN|-
| | |
--|RST XOUT|-
| |
| P6.1/A1|<- 1V
| P1.0|-> LED
| |
This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:
This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.
Definition at line 190 of file adc10_a_ex6_refToggle.c.
References i.
Referenced by main().
| void main | ( | void | ) |
Definition at line 76 of file adc10_a_ex6_refToggle.c.
References __delay_cycles(), delay(), GPIO_setOutputHighOnPin(), and GPIO_setOutputLowOnPin().